function [P_3,T_3,rou_3,Ma_3,a_3]=oblique_shock(WAD,kk,P_0,T_0,rou_0,Ma,d2,y_max)
Y1=@(x)(WAD-2*((1-x)^0.5/x^0.5*(Ma^2*x-1))/(Ma^2*(kk+1-2*x)+2));
%% U形函数求左零点
d1=0;
eps=1e-8;
while ((abs(Y1(d1))+abs(Y1(d2)))/2)>=eps
    if WAD>y_max
        d1=1-1/(1+WAD^2);
        break
    end
    d_t=(d1+d2)/2;
    if (Y1(d1)*Y1(d_t)<0)
        d2=d_t;
    else
        d1=d_t;
    end
    if abs(d1-d2)<1e-12
        'Looping! Help!'
        pause
    end
end
%% 参数计算
b_temp=d1;
rou_3=((1+kk)*Ma^2*b_temp*rou_0)/(2+(kk-1)*Ma^2*b_temp);
P_3=(1+(2*kk/(1+kk))*(Ma^2*b_temp-1))*P_0;
T_3=(2*kk*Ma^2*b_temp-(kk-1))*((kk-1)*Ma^2*b_temp+2)*T_0/((1+kk)^2*Ma^2*b_temp);
Ma_3=((Ma^2+(2/(kk-1)))/((2*kk/(kk-1))*Ma^2*b_temp-1)+(Ma^2*(1-b_temp))/(((kk-1)/2)*Ma^2*b_temp+1))^0.5;
a_3=(kk*P_3/rou_3)^0.5;
end